import request from '@/utils/request'

export function getNews(params) {
  return request({
    url: '/news/web',
    method: 'get',
    params
  })
}

export function getPlatform() {
  return request({
    url: '/news/get_web',
    method: 'get'
  })
}

export function addAlter(id, data) {
  return request({
    url: `/news/alter/${id}`,
    method: 'put',
    data
  })
}

export function filterModel(id) {
  return request({
    url: `/news/site/${id}`,
    method: 'get'

  })
}
export function getTotal(name) {
  return request({
    url: `/user/num/${name}`,
    method: 'get'

  })
}

export function getModifyList(name) {
  return request({
    url: `/news/alter_list/${name}`,
    method: 'get'

  })
}

export function modifyNews(id, data) {
  return request({
    url: `/news/alter_news/${id}`,
    method: 'put',
    data
  })
}
